package sample.tomcat;

import java.util.Map;
import java.util.Map.Entry;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import io.swagger.annotations.Api;
import sample.tomcat.tools.AnnotationTool;

@Component("startUpEvent")
public class StartUpEvent implements ApplicationListener {
	
	@Override
	public void onApplicationEvent(ApplicationEvent arg0) {
		System.out.println("初始化完成2");
		Map<String, Object> abc=SpringUtils.getApplicationContext().getBeansWithAnnotation(Api.class);
		for (String key : abc.keySet()) {  
		    System.out.println("Key = " + key);

		}
		//遍历map中的值
		for (Object value : abc.values()) {
		    System.out.println("Value = " + value.getClass());
			AnnotationTool.getMethodInfo(value.getClass());
		}
		System.out.println(abc);
	}

}
